﻿#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion

namespace BreakOutBattles.Game
{
    #region Enums
    public enum GameStates
    {
        /// <summary>
        /// The game is showing the main menu.
        /// </summary>
        MENU,

        /// <summary>
        /// The game is showing the create game menu.
        /// </summary>
        CREATE_GAME,

        /// <summary>
        /// The game is showing the join game menu.
        /// </summary>
        JOIN_GAME,

        /// <summary>
        /// The game host is waiting for another player to connect.
        /// </summary>
        PLAYER_JOIN_WAIT,

        /// <summary>
        /// The game is waiting for the host to send its match
        /// configuration.
        /// </summary>
        HOST_WAIT,

        /// <summary>
        /// The game is running.
        /// </summary>
        GAME_RUNNING,

        /// <summary>
        /// The game is over. 
        /// </summary>
        GAME_OVER,

        /// <summary>
        /// The game has been paused.
        /// </summary>
        GAME_PAUSED,

        /// <summary>
        /// The game is currently showing the match report window.
        /// </summary>
        MATCH_REPORT
    }
    #endregion

    /// <summary>
    /// A simple class that provides a way to get and set the current state of the game.
    /// </summary>
    public static class GameState
    {
        private static GameStates prevGameState = GameStates.MENU;
        private static GameStates currentState = GameStates.MENU;

        /// <summary>
        /// Gets or sets the current state of the game.
        /// </summary>
        public static GameStates CurrentState
        {
            get
            {
                return currentState;
            }
            set
            {
                prevGameState = currentState;
                currentState = value;
            }
        }

        /// <summary>
        /// Gets the previous game state, that is the state the game had just before a new 
        /// state was set.
        /// </summary>
        public static GameStates PrevState
        {
            get { return prevGameState; }
        }
    }
}
